﻿<Window x:Class="TicTacToe.UI.LoadGameWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Load Game" Height="400" Width="320" ResizeMode="CanMinimize"
        Icon="..\3dtictactoe.png" x:ClassModifier="internal"
        Closing="Window_Closing" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="26" />
            <RowDefinition />
            <RowDefinition Height="29" />
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>
        
        <Label Grid.Row="0" Content="Select Saved Game:" />
        
        <ListBox Name="savesListBox" Grid.Row="1" Margin="6">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Height="34" Width="275" CornerRadius="2" Margin="1" BorderBrush="Black" BorderThickness="1">
                        <StackPanel Margin="3,0" Orientation="Vertical">
                            <Grid>
                                <TextBlock HorizontalAlignment="Left">
                                    <Run Foreground="{Binding Path=Player1Color}" Text="{Binding Path=Player1Name}" />
                                    <Run Foreground="DimGray" Text="vs" />
                                    <Run Foreground="{Binding Path=Player2Color}" Text="{Binding Path=Player2Name}" />
                                </TextBlock>
                                <TextBlock HorizontalAlignment="Right">
                                    <Run Foreground="Black" Text="{Binding Path=TurnCount}" />
                                    <Run Foreground="DimGray" Text="Turns" />
                                </TextBlock>
                            </Grid>
                            <TextBlock>
                                    <Run Foreground="DimGray" Text="Saved:" />
                                    <Run Foreground="Black" Text="{Binding Path=SaveTime}" />
                            </TextBlock>
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
        <Button Name="deleteSelectedButton" Style="{StaticResource buttonStyle}" Content="Delete Selected" Grid.Row="2" HorizontalAlignment="Left" Margin="6,3,0,3" Width="100" Click="deleteSelectedButton_Click" />
        <Button Name="deleteAllButton" Style="{StaticResource buttonStyle}" Content="Delete All" Grid.Row="2" HorizontalAlignment="Left" Margin="112,3,0,3" Width="100" Click="deleteAllButton_Click" />

        <Button Name="loadGameButton" Style="{StaticResource buttonStyle}" Content="Load Game" Grid.Row="3" HorizontalAlignment="Right" Margin="0,3,6,6" Width="125" Click="loadGameButton_Click" />
    </Grid>
</Window>
